LinkamCMS segfaults in Linux · Issue #273 · python | 您所在的位置:网站首页 › stack smashing detected unknown terminated › LinkamCMS segfaults in Linux · Issue #273 · python |
This issue is happening when setting the callback for status events: typedef void (*EventNewValueCallback)(CommsHandle hDevice, LinkamSDK::ControllerStatus status);We can't pass unions and structures and bit-fields by value. But that's the interface for the callback so we can't just change it pointer. But I think we can drop the bit-fields ourselves. ControllerStatus is a union where one member is a struct with access to each bit and a 64bit int that holds all the flags: union ControllerStatus { struct { unsigned controllerError : 1; // ... 63 other bit-fields } flags; ///< Accessor to the flags. uint64_t value; ///< Flags as a single value; };If the problem is the bit-field, we should be able to remove the flags struct from the ControllerStatus union and simply pass a uint64_t and manually access the bits we care about ourselves. Unfortunately, the Linkam API does this a lot so we probably need to do the same in a bunch of other places I do not have access the hardware to do this though. |
今日新闻 |
推荐新闻 |
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 |